import request from '@/utils/request.js'
const PATH = '/mobile/user/'

// 用户注册
export const register = (data) => request.post(PATH + 'register', data)

// 用户登录
export const login = (data) => request.post(PATH + 'login', data)

// 校验密码
export const verifyPwd = ({ id, password }) =>
  request.get(PATH + 'verifyPwd', { params: { id, password } })

// 修改密码
export const updatePwd = ({ id, password }) =>
  request.put(PATH + `updatePwd/${id}/${password}`)

// 验证手机后是否正确
export const verifyPhone = (params) =>
  request.get(PATH + 'verifyPhone', { params })

// 重置密码
export const resetPwd = (data) => request.put(PATH + 'resetPwd', data)

// 获取用户信息
export const getUserInfo = (params) =>
  request.get(PATH + 'getUserById', { params })

// 修改用户信息
export const updateUserInfo = (data) => request.put(PATH + 'update', data)

// 修改最后活动时间
export const updateLastActiveTime = ({ id }) =>
  request.put(PATH + `modify/${id}`)
